package sdfi.lee.Entity.base;

import java.io.Serializable;

import sdfi.lee.Entity.Rolltype;
import sdfi.lee.Entity.User;


/**
 * This is an object that contains data related to the character table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="character"
 */

public abstract class BaseCharacter  implements Serializable {

	public static String REF = "Character";
	public static String PROP_USERID = "userid";
	public static String PROP_ROLLTYPE = "rolltype";
	public static String PROP_KEYWORD = "keyword";
	public static String PROP_ID = "id";


	// constructors
	public BaseCharacter () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseCharacter (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String keyword;

	// many to one
	private sdfi.lee.Entity.Rolltype rolltype;
	private sdfi.lee.Entity.User userid;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: keyword
	 */
	public java.lang.String getKeyword () {
		return keyword;
	}

	/**
	 * Set the value related to the column: keyword
	 * @param keyword the keyword value
	 */
	public void setKeyword (java.lang.String keyword) {
		this.keyword = keyword;
	}



	/**
	 * Return the value associated with the column: rolltype
	 */
	public sdfi.lee.Entity.Rolltype getRolltype () {
		if(rolltype==null)rolltype=new Rolltype();
		return rolltype;
	}

	/**
	 * Set the value related to the column: rolltype
	 * @param rolltype the rolltype value
	 */
	public void setRolltype (sdfi.lee.Entity.Rolltype rolltype) {
		this.rolltype = rolltype;
	}



	/**
	 * Return the value associated with the column: userid
	 */
	public sdfi.lee.Entity.User getUserid () {
		if(userid==null) userid=new User();
		return userid;
	}

	/**
	 * Set the value related to the column: userid
	 * @param userid the userid value
	 */
	public void setUserid (sdfi.lee.Entity.User userid) {
		this.userid = userid;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof sdfi.lee.Entity.Character)) return false;
		else {
			sdfi.lee.Entity.Character character = (sdfi.lee.Entity.Character) obj;
			if (null == this.getId() || null == character.getId()) return false;
			else return (this.getId().equals(character.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}